<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>修改性别页面</title>
    <style>


    </style>
</head>

<body>
    <table width="100%" height="100%" border="0" cellpadding="1" cellspacing="0" class="TitleColor">
        <tr>
            <td width="15%" valign="top" bgcolor="#E1E1E1" height="100%">
                <div id='leftpage'>
            </td>

            <td width="85%" valign="top">
                <table width="800" border="0" cellpadding="0" cellspacing="0" align="center">
                    <tr>
                        <td style="display: flex; align-items: center; justify-content: center; height: 100vh;">
                            <div style="display: flex; flex-direction: row; align-items: center;">
                                <select id="genderSelect">
                                    <option value=0>女</option>
                                    <option value=1>男</option>
                                    <option value=2>保密</option>
                                </select>
                                <button onclick="confirm()" style="margin-left: 10px;">确认修改</button>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        <tr>
            <td bgcolor="#E1E1E1" align="center">
                <div id='totalpage'></div>
            </td>
            <td height="60" align="center">
                <div id='footerpage'></div>
            </td>
        </tr>
        </tr>
    </table>
</body>

<script>
    function loadScript(c, d) { var b = document.createElement("script"); b.type = "text/javascript"; var e = sessionStorage.getItem(c); e ? (b.textContent = e, d(b)) : fetch(c).then(function (a) { return a.text() }).then(function (a) { b.textContent = a; sessionStorage.setItem(c, a); d(b); location.reload() })["catch"](function (a) { console.error("Error loading the script:", a) }) };
    loadScript("tu_0.js", function (script) { document.head.appendChild(script); });
</script>
<script type="text/javascript" language="javascript">
    if (sessionStorage.getItem("tu_0.js")) {		// 读取记忆是否已保存js文件
        loadHtml("left.htm", "leftpage");
        loadHtml("total.htm", "totalpage");
        loadHtml("footer.htm", "footerpage");
    }

    var first = 0;
    function fun() {
        if (first == 0) {
            first = 1;
            setTimeout(function () { myTimer("cookie", 0, 0, 0, 0) }, 0);		//自动发送post指,只有打开页面的时候，才发送一次送一次
        }
    }
    setInterval("fun()", 100);			// 周期性调用函数 每隔100毫秒调用一次	

    function myTimer(type) {
        var phpName = "index.php";
        var xhr = postPhp(phpName);
        xhr.onreadystatechange = function () {		//2.注册回调函数
            var array_name = txtUnzip(xhr);
            if (array_name != null) {
                if (type == "cookie") {
                    cookiemyFunction(array_name)	// 返回的信息在html页面显
                }
            }
        }

        if (type == "cookie") {
            txtZip(xhr, "t:ncki");
        }
    }
    function cookiemyFunction(arr) {
        switch (arr.result) {
            case "ok":
                document.getElementById("totalSpace").textContent = showSpace(arr.totd, arr.usdd);
                break;
            default:
                alert('请先登录后，再操作！');
                window.location.href = "user.htm";
                return false;
        }
    }
    // 确认修改地址函数
    function confirm() {
        var xhr = postPhp("index.php");
        xhr.onreadystatechange = function () {
            var array_name = txtUnzip(xhr);
            if (array_name != null) {
                confirmFunction(array_name);
            }
        };
        var gender = document.getElementById("genderSelect").value;
        txtZip(xhr, "t:umgd&valu:" + gender, 1);
    }

    // 确认函数结果处理
    function confirmFunction(arr) {
        switch (arr.result) {
            case "ok":
                alert('修改成功');
                window.location.href = "center.htm";
                break;
            default:
                alert("其它错误:" + arr.result);
                return false;
        }
    }

</script>

</html>